Skip to content

fix(web): tolerate external project script ids in keybinding commands - #112

Merged
lastobelus merged 2 commits into
lastcode/mainfrom
port/upstream/pr-7961-tolerate-project-script-ids
Aug 27, 2026
Merged

lastobelus merged 2 commits into
lastcode/mainfrom
port/upstream/pr-7961-tolerate-project-script-ids

Conversation

@lastobelus

@lastobelus lastobelus commented Aug 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • import the maintainer-preferred fix from fix(web): tolerate external project script ids in keybinding commands pingdotgg/t3code#7961 at pinned head 6be823df41b105ddee33677f0b72aa4f5ad1c868
  • accept every canonical non-empty project-script ID when constructing dynamic keybinding commands, matching the existing ProjectScript contract
  • keep UI-generated IDs as the existing lowercase slugs while allowing externally supplied and already-saved IDs
  • reject whitespace-padded dynamic commands instead of accepting shortcuts that cannot match normalized saved IDs

Incident

A saved action in a LastCode server environment used ID build-intel-package-macos (25 characters). The renderer mapped that valid project script through a 24-character template-literal schema during render, throwing Expected a string matching template literal parts in both thread controls and Project Settings.

No persisted project data was changed or migrated.

Validation

  • 24 focused tests across the dynamic-command contract, project-script helpers, and project-script keybinding decoder
  • contracts and web typechecks
  • focused formatting and lint
  • committed-range git diff --check
  • disposable matched fixture with the exact 25-character action ID rendered in chat
  • locally installed recovery build opened existing saved state from a LastCode GUI node and rendered Build Intel package (macOS) in Project Settings

Provenance

Refs #103

The server accepts any non-empty trimmed string as a ProjectScript id,
but the client's SCRIPT_RUN_COMMAND_PATTERN only allowed lowercase slugs
of up to 24 characters. An id dispatched over the API (e.g. a UUID) made
commandForProjectScript throw during render, crashing every thread view
and the project settings panel with no way to repair from the UI.

Relax the pattern's middle segment to TrimmedNonEmptyString, matching
the server-side constraint. UI-generated ids are still slugs via
nextProjectScriptId, so nothing changes for normal usage; existing
keybinding rules keep decoding.

Fixes pingdotgg#7851

Worked on by ox-alpha via the pi coding agent harness.

(cherry picked from commit 6be823d)
@lastobelus
lastobelus force-pushed the port/upstream/pr-7961-tolerate-project-script-ids branch from 5956bf5 to f0434c7 Compare August 27, 2026 20:46

ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5956bf5b6c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/contracts/src/keybindings.ts Outdated
Comment thread packages/contracts/src/keybindings.ts Outdated
@lastobelus

ghost commented Aug 27, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

ghost commented Aug 27, 2026

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 935b8f90c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus merged commit e89a228 into lastcode/main Aug 27, 2026
@lastobelus
lastobelus deleted the port/upstream/pr-7961-tolerate-project-script-ids branch August 27, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants